﻿using System;
using System.Linq;
using OSCSchema;
using OutlookSocialProvider;

namespace OSC.Base
{
    internal class SocialProfile : SocialPerson, ISocialProfile
    {
        #region Constructor
        public SocialProfile(IPerson person, ISocialConnector session, ICachingStrategy cachingStrategy, IConverter<IPerson, personType> personConverter, IConverter<Activity, activityDetailsType> activityConverter, IConverter<IActivityTemplate, activityTemplateContainerType> activityTemplateConverter)
            : base(person, session, cachingStrategy, personConverter, activityConverter, activityTemplateConverter)
        {
        }
        #endregion

        #region Methods
        public bool[] AreFriendsOrColleagues(string[] userIDs)
        {
            var friends = GetFriendsAndColleaguesIDs();
            return userIDs.Select(id => friends.Contains(id)).ToArray();
        }
        public string GetActivitiesOfFriendsAndColleagues(DateTime startTime)
        {
            var ids = GetFriendsAndColleaguesIDs();
            return GetActivityFeeds(ids.SelectMany(id => GetActivities(id, startTime)));
        }
        public void SetStatus(string status)
        {
            //This method is currently not supported.
            throw new NotImplementedException();
        }
        #endregion
    }
}